package com.friendsoft.crm.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author huyduong
 */
@Table(name="crm_user")
@Entity
public class User extends BaseEntity {
	private static final long serialVersionUID = 1L;

	@Column(name="username")
	private String username ;

	@Column(name="password")
	private String password ;

	@OneToMany(mappedBy="user", cascade = {CascadeType.REFRESH})
	private List<Contact> contacts ;

	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * @param username the username to set
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * @param password the password to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * @return the contacts
	 */
	public List<Contact> getContacts() {
		return contacts;
	}

	/**
	 * @param contacts the contacts to set
	 */
	public void setContacts(List<Contact> contacts) {
		this.contacts = contacts;
	}

	/**
	 * default constructor
	 */
	public User() {

	}
}
